<?php


namespace app\mobile\controller;

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');

use app\common\model\User;
use think\App;
use think\Controller;
use think\facade\Request;

class LoggingBase extends Controller
{

    public $m_User;

    function __construct(App $app = null)
    {
        parent::__construct($app);

        $Token = Request::has('Token') ? Request::param('Token') : '';
        if (!$Token) {
            mb_OutMessage(ErrCode_Distance,'该账号已下线');
        }

        $User = new User();
        $UserData = $User->mb_Get("MobileToken='$Token' AND IsDeleted='0'");
        if ($UserData == null || $UserData->Level != Level_CRMUser) {
            mb_OutMessage(ErrCode_Distance,'该账号已下线');
        }
        $this->m_User = $UserData;
    }

}